# -*- coding: utf-8 -*-



import  wx
import  os
import sys

import mainui 


def main(params = None):
    
    rd = False #True
    
    if params is None:
        params = [""]
    
    if len(sys.argv) > 1:
        params = sys.argv[1:]
    
    # Create single instance semaphore
    single_instance_checker = wx.SingleInstanceChecker("ideagen" + wx.GetUserId())

    if single_instance_checker.IsAnotherRunning():
        # Send  torrent info to abc single instance
        #ClientPassParam(params[0])
        pass
    else:
        vpath = os.path.abspath(os.path.dirname(sys.argv[0]))
        print vpath
        os.chdir(vpath)
        app = mainui.RunApp(redirect=rd)
        app.MainLoop()

if __name__ == "__main__":
    main()

